﻿@using Telerik.Web.Mvc.UI
@using MvcFront.Models
@{
    ViewBag.Title = "Утвержденные документы";
}
    @Html.ValidationSummary(true)
<h2>Утвержденные документы</h2>
@(Html.Telerik().Grid<DocumentListViewModel>()
            .DataBinding(dataBinding => dataBinding.Ajax().Select("_SubmittedUserDocumentsList", "UserDocument", new { }))
        .Name("DocumentListGrid")
                   .Columns(columns =>
                   {
                       columns.AutoGenerate(column =>
                       {
                           column.Width = "150px";
                           if (column.Member == "DocumentId" || column.Member == "IsReadOnly" || column.Member == "IsRed" || column.Member == "DocumentStatusText")
                               column.Visible = false;
                       });
                       columns.Command(command =>
                       {
                           command.Custom("viewDetails").Text("Просмотр")
                            .DataRouteValues(route => route.Add(o => o.DocumentId).RouteKey("id"))
                            .Action("DocumentDetails", "UserDocument")
                            .HtmlAttributes(new { style = "text-align: center" });
                       }).Width(50);
                   })

                 .Sortable()
                .Pageable()
                .Filterable()
                )
